﻿using System;
using System.Collections.Generic;
using Wombat.Bootstrappers.Essentials;
using Wombat.Core;
using Wombat.Core.Factories;
using Wombat.Core.Gates;
using Wombat.Core.Services;
using Wombat.Data;
using Wombat.Data.Model.Factories;
using Wombat.Scripting;
using Wombat.WcfClientGate;
using Wombat.WcfGate;

namespace Wombat.ServerHost
{
    internal static class TypeCatalog
    {
        public static readonly IDictionary<Type, Type> Singletons = new Dictionary<Type, Type>
            {
                {typeof(IConfigurationService), typeof(ConfigurationService)},
                {typeof(IConfigurationServiceLoader), typeof(ConfigurationService)},
                {typeof(IObservationManager), typeof(ObservationManager)},
                {typeof(ITagRpository), typeof(TagRpository)},
                {typeof(ITagRepositoryLoader), typeof(TagRpository)},
                {typeof(ITagStateService), typeof(TagStateService)},
                {typeof(IDataService), typeof(DataService)},
                {typeof(IDiagnosticsService), typeof(DiagnosticsService)},
                {typeof(IEntitiesFactory), typeof(EntitiesFactory)},
            };

        public static readonly IDictionary<Type, Type> KnownInstances = new Dictionary<Type, Type>
            {
                {typeof(IBootstrapper), typeof(Bootstrap)},
                {typeof(ITagFactory), typeof(TagFactory)},
                {typeof(ISpecialValueFactory), typeof(SpecialValueFactory)},
                {typeof(ITagValueFactory), typeof(TagValueFactory)},
                {typeof(IDynamicCodeServicePeer), typeof(PythonCodeServicePeer)}
            };

        public static readonly ISet<Type> Gates = new HashSet<Type>
            {
                typeof(WcfExportGate),
                typeof(WcfFloatTagService),
                typeof(CodeBlockExecuterGate),
                typeof(FloatStorageGate)
            };
    }
}
